package com.project.blog.controller;

import com.project.user.entity.entitly.UserInfo;

import java.util.List;

public interface BlogInformation {
    /**
     * get blog list for userinfo or get host blog list or search blog info list
     * @param user user info
     * @param blog blog info
     * @return
     * - user's Id is not null:get blog list for userinfo;
     * - blog's id is not null:search blog info list for blog's id;
     * - blog's title is bot null:search blog info list for blog's title;
     * - user's Id is null and blog's id is null:search host blog info;
     * @throws Exception sqlExample
     */
    List<BlogInformation> searchBlogInformation(UserInfo user,BlogInformation blog) throws Exception;

    /**
     * insert successfully
     * @param blog blog info
     * @return insert successfully
     * @throws Exception sqlExample
     */
    int insertBlogInformation(BlogInformation blog) throws Exception;

    /**
     * delete successfully
     * @param blog blog info
     * @return delete successfully
     * @throws Exception SqlExample
     */
    int deleteBlogInformation(BlogInformation blog) throws Exception;

    /**
     * update successfully
     * @param blog blog info
     * @return update successfully
     * @throws Exception sqlExample
     */
    int updateByExampleSelective(BlogInformation blog) throws Exception;
}
